/* Admin Dashboard Styles */

/* Dashboard container and overall layout */
.admin-dashboard {
    width: 100%;
    max-width: 1400px; /* desktop cap to create large side margins */
    margin: 0 auto;
    padding: 10px 20px;
    box-sizing: border-box;
}

/* Dashboard header section container */
.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
}

/* Main dashboard title style */
.dashboard-title {
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    color: white;
    margin-bottom: 15px;
    letter-spacing: 4px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

/* Dashboard subtitle style */
.dashboard-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.2rem;
    margin-bottom: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Toolbar Section */
/* Primary admin toolbar container */
.toolbar-section {
    display: flex; /* block-level flex so margin auto centers */
    justify-content: center; /* center all controls within the pill */
    align-items: center;
    margin: 0 auto 40px; /* center the pill */
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    gap: 10px; /* tighter spacing for inline fit */
    flex-wrap: nowrap; /* keep single line */
    width: fit-content; /* shrink to exactly fit six controls */
    max-width: 100%; /* never exceed viewport */
    box-sizing: border-box;
    position: relative; /* enable z-index stacking context */
    overflow: visible; /* no scrollbars; container holds content */
}

/* Left-side toolbar controls group */
.toolbar-left {
    display: flex;
    gap: 12px; /* tighter spacing for inline fit */
    align-items: center;
    flex-wrap: nowrap; /* keep single line */
    flex: 0 0 auto;
    min-width: 0;
    width: auto;
}

/* Sidebar toggle button styling */
.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #8b6914 0%, #6b5011 100%);
    color: white;
    border: 2px solid #8b6914;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 15px rgba(139, 105, 20, 0.3);
    white-space: nowrap; /* keep label inline */
}

.sidebar-toggle-btn:hover {
    background: linear-gradient(135deg, #a67c16 0%, #8b6914 100%);
    box-shadow: 0 6px 20px rgba(139, 105, 20, 0.4);
    transform: translateY(-2px);
}

.sidebar-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(139, 105, 20, 0.3);
}

.toolbar-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 15px; /* consistent distance between interactive elements */
    flex-wrap: nowrap; /* keep inline */
}

/* Search Input */
/* Search input wrapper and positioning */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 1 auto;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: rgba(255, 255, 255, 0.6);
    z-index: 1;
    pointer-events: none;
}

/* Search text input appearance */
.search-input {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    height: 44px;
    padding: 10px 12px 10px 42px; /* consistent vertical padding, extra left for icon */
    color: white;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    width: clamp(160px, 14vw, 220px);
    min-width: 160px;
    max-width: 220px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: rgba(84, 0, 0, 0.6);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(84, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

/* Filter Select */
/* Filter dropdown styling */
.filter-select {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    height: 44px;
    padding: 10px 14px; /* consistent control padding */
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: clamp(140px, 12vw, 180px); /* reduced width for compact fit */
    min-width: 140px;
    max-width: 180px;
    box-sizing: border-box;
    position: relative;
    z-index: 5; /* maintain visual hierarchy above neighbors */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0; /* rely on container gap for spacing */
    display: inline-flex;
    align-items: center;
}

@keyframes dropdownExpand {
    0% { transform: scale(0.98); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

.filter-select:focus {
    outline: none;
    border-color: rgba(84, 0, 0, 0.6);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(84, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    animation: dropdownExpand 0.18s ease-out;
}

.filter-select:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
}

.filter-select option {
    background: #1a1a1a;
    color: white;
    padding: 12px 15px; /* top/bottom: 12px, left/right: 15px */
    border: none;
}

/* Toolbar Right */
.toolbar-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 12px; /* tighter spacing for inline fit */
    flex-wrap: nowrap; /* keep single line */
}

/* Add Category Button */
/* Button style for adding categories */
.add-category-btn {
    background: linear-gradient(135deg, #0d4f4f 0%, #0d6d6d 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    height: 44px;
    padding: 10px 14px; /* consistent control padding */
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 16px; /* increase spacing between icon and text */
    box-shadow: 0 6px 20px rgba(13, 79, 79, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 160px;
    width: clamp(160px, 16vw, 180px); /* equalized button width */
    box-sizing: border-box;
    white-space: nowrap; /* keep label inline */
    text-overflow: ellipsis;
}

.add-category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.add-category-btn:hover {
    background: linear-gradient(135deg, #0d6d6d 0%, #0d8a8a 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(13, 79, 79, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.add-category-btn:hover::before {
    left: 100%;
}

.add-category-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(13, 79, 79, 0.3);
}

/* Add Product Button */
/* Button style for adding products */
.add-product-btn {
    background: linear-gradient(135deg, #540000 0%, #6d0000 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    height: 44px;
    padding: 10px 14px; /* consistent control padding */
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(84, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 160px;
    width: clamp(160px, 16vw, 180px); /* equalized button width */
    box-sizing: border-box;
    white-space: nowrap; /* keep label inline */
    text-overflow: ellipsis;
}

.add-product-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.add-product-btn:hover {
    background: linear-gradient(135deg, #6d0000 0%, #8a0000 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(84, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.add-product-btn:hover::before {
    left: 100%;
}

.add-product-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(84, 0, 0, 0.3);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
    width: 100%;
    box-sizing: border-box;
}

.admin-product-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.admin-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: #dee2e6;
}

.admin-product-card:hover .product-image-admin {
    border-color: #adb5bd;
}

/* Product Status */
.product-status {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.status-visible {
    background: #d4edda;
    color: #155724;
}

.status-hidden {
    background: #f8d7da;
    color: #721c24;
}

/* Stock Badge */
.stock-badge {
    position: absolute;
    top: 40px;
    right: 8px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.stock-badge.in-stock {
    background: #d4edda;
    color: #155724;
}
.stock-badge.low-stock {
    background: #fff3cd;
    color: #856404;
}
.stock-badge.critical-stock {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.stock-badge.out-of-stock {
    background: #f5c6cb;
    color: #721c24;
}

/* Product Image */
.product-image-admin {
    width: 100%;
    height: 150px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.product-image-admin img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder-admin {
    font-size: 24px;
    color: #6c757d;
}

/* Product Details */
.product-details {
    color: #333;
}

.product-title-price-row-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
    gap: 15px;
}

.product-title-admin {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #000;
    flex: 1;
    text-align: left;
}

.product-description-admin {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-price-admin {
    font-size: 16px;
    font-weight: 700;
    color: #540000;
    margin: 0;
    text-align: right;
    white-space: nowrap;
}

.product-category-admin {
    font-size: 12px;
    color: #888;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Admin Actions */
.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
}

.edit-btn {
    background: linear-gradient(135deg, #0d4f4f 0%, #0d6d6d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(13, 79, 79, 0.3);
}

.edit-btn:hover {
    background: linear-gradient(135deg, #0d6d6d 0%, #0d8a8a 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 79, 79, 0.4);
}

.delete-btn {
    background: linear-gradient(135deg, #540000 0%, #6d0000 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(84, 0, 0, 0.3);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #6d0000 0%, #8a0000 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(84, 0, 0, 0.4);
}

.toggle-visibility-btn {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}

.toggle-visibility-btn:hover {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.4);
}

.toggle-visibility-btn.hidden {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.toggle-visibility-btn.hidden:hover {
    background: linear-gradient(135deg, #545b62 0%, #3d4142 100%);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2100;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.product-modal {
    background: #2c1810;
    border-radius: 12px;
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

/* Confirm Delete Modal */
#confirmDeleteOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2200;
    /* effects removed */
}
#confirmDeleteOverlay.active {
    display: flex;
}
#confirmDeleteModal {
    background: #2c1810; /* keep existing color */
    border-radius: 20px; /* softer, pill-like corners */
    border: 1px solid rgba(255, 255, 255, 0.15); /* subtle outline like Cancel */
    max-width: 480px;
    width: 95%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08); /* add inset highlight */
    overflow: hidden;
    /* animation removed */
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#confirmDeleteModal .modal-header {
    background: linear-gradient(135deg, #2c1810 0%, #1a0f0a 100%);
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0; /* match container rounding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
#confirmDeleteModal .modal-title {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: white;
    text-align: center !important;
    width: 100%;
}
#confirmDeleteModal .close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease; /* add smooth transition like other modals */
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
#confirmDeleteModal .close-btn:hover {
    background-color: rgba(255, 255, 255, 0.18); /* subtle glow */
    transform: rotate(90deg); /* consistent hover animation */
}
#confirmDeleteModal .close-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2); /* accessible focus ring */
}
/* Show X close controls for admin dashboard modals */
#confirmDeleteModal .close-btn { display: inline-flex; }
#sidebarManagerModal .close-btn { display: inline-flex; }

#confirmDeleteModal .modal-content {
    padding: 16px 20px 8px 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 420px;
    width: 92%;
    box-sizing: border-box;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.12); /* gentle inner outline */
    border-radius: 14px; /* subtle rounding inside */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); /* soft inner highlight */
}
#confirmDeleteMessage {
    margin: 0;
    line-height: 1.5;
    width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}
#confirmDeleteModal .modal-actions {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 20px 12px 20px;
}

/* Add admin-style animations to modal buttons */
#confirmDeleteModal .modal-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    vertical-align: middle;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    padding: 12px 22px;
    min-height: 44px;
    font-size: 16px;
    border-radius: 6px;
}
#confirmDeleteModal .modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}
#confirmDeleteModal .modal-btn:hover {
    transform: translateY(-1px);
}
#confirmDeleteModal .modal-btn:hover::before {
    left: 100%;
}
#confirmDeleteModal .modal-btn:active {
    transform: translateY(0);
}

#confirmDeleteModal .modal-btn.delete {
    background: linear-gradient(135deg, #540000 0%, #6d0000 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.18); /* subtle outline to match Cancel */
    border-radius: 6px;
    padding: 12px 24px;
    font-weight: 600;
    box-shadow: 
        0 6px 16px rgba(84, 0, 0, 0.35), /* deeper red drop shadow */
        0 0 12px rgba(255, 255, 255, 0.12); /* soft ambient glow like Cancel */
}
#confirmDeleteModal .modal-btn.delete:hover {
    background: linear-gradient(135deg, #6d0000 0%, #8a0000 100%);
    box-shadow: 
        0 8px 22px rgba(84, 0, 0, 0.45), /* stronger red shadow on hover */
        0 0 18px rgba(255, 255, 255, 0.16); /* brighter ambient glow */
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.24);
}
#confirmDeleteModal .modal-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 12px 24px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}
#confirmDeleteModal .modal-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 18px rgba(255, 255, 255, 0.18);
}

/* OK button styled to match nav link aesthetic */
#confirmDeleteModal .modal-btn.ok-nav {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 12px 24px;
    min-width: 120px;
    min-height: 44px;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Mobile-specific adjustments: keep tap targets comfortable */
@media (max-width: 480px) {
    #confirmDeleteModal .modal-actions {
        gap: 10px;
    }
    #confirmDeleteModal .modal-btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 16px;
    }
}
#confirmDeleteModal .modal-btn.ok-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 255, 255, 0.18);
}

/* Override: keep actions inline and aligned */
#confirmDeleteModal .modal-actions {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* Success message boxed container to avoid floating text */
#confirmDeleteMessage.boxed {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0 4px;
    text-align: center;
}

/* Edit Category Modal (styles mirror Confirm Delete Modal) */
#editCategoryModal {
    background: #2c1810;
    border-radius: 12px;
    max-width: 520px;
    width: 95%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}
#editCategoryModal .modal-header {
    background: linear-gradient(135deg, #2c1810 0%, #1a0f0a 100%);
    color: white;
    padding: 18px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
#editCategoryModal .modal-title {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: white;
    text-align: center !important;
    width: 85%;
}
#editCategoryModal .close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: none;
    line-height: 1;
    padding: 0;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
#editCategoryModal .close-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: none;
}
/* ensure X close control is visible like other admin modals */
#editCategoryModal .close-btn { display: inline-flex; }

#editCategoryModal .modal-content {
    padding: 20px;
    display: block;
    max-width: 480px;
    width: 92%;
    box-sizing: border-box;
}
#editCategoryModal label {
    display: block;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}
#editCategoryModal input[type="text"] {
    width: 90%;
    padding: 15px 15px 15px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #1a0f0a;
    color: #fff;
    outline: none;
    transition: all 0.2s ease;
}
#editCategoryModal input[type="text"]::placeholder { color: rgba(255, 255, 255, 0.6); }
#editCategoryModal input[type="text"]:focus {
    border-color: #20c997;
    box-shadow: 0 0 0 3px rgba(32, 201, 151, 0.25);
}
#editCategoryError { color: #ff4d4f; }

#editCategoryModal .modal-actions {
    display: block;
    text-align: center;
    padding: 1px 2px 20px 2px;
}
#editCategoryModal .modal-btn {
    position: relative;
    overflow: hidden;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 140px;
    margin: 0 6px;
    padding: 12px 20px;
}
#editCategoryModal .modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}
#editCategoryModal .modal-btn:hover { transform: translateY(-1px); }
#editCategoryModal .modal-btn:hover::before { left: 100%; }
#editCategoryModal .modal-btn:active { transform: translateY(0); }

#editCategoryModal .modal-btn.save {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}
#editCategoryModal .modal-btn.save:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}
#editCategoryModal .modal-btn.cancel {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 12px 24px;
    min-width: 100px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#editCategoryModal .modal-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.modal-header {
    background: linear-gradient(135deg, #2c1810 0%, #1a0f0a 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: white;
    text-align: center;
    width: 100%;
}

.product-modal .close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-modal .close-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-content {
    padding: 20px 30px 30px 30px;
    flex: 1;
    overflow-y: auto;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #f5f5f5;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #4a3426;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #3d2b1f;
    color: #f5f5f5;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: #8b6914;
    background: #4a3426;
    box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.2);
}

.form-textarea {
    resize: vertical;
    height: 200px;
    min-height: 200px;
    line-height: 1.5;
    overflow-y: auto;
}

.file-input {
    padding: 12px 16px;
    background: #3d2b1f;
    border: 2px dashed #4a3426;
    cursor: pointer;
    color: #f5f5f5;
}

.file-input:hover {
    border-color: #8b6914;
    background: #4a3426;
}

.form-help-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #b8a082;
    font-style: italic;
}

.form-checkbox-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #3d2b1f;
    border-radius: 8px;
    border: 2px solid #4a3426;
    transition: all 0.3s ease;
    height: 30px;
}

.form-checkbox-group:hover {
    border-color: #8b6914;
    background: #4a3426;
}

.form-checkbox {
    width: 8px;
    height: 14px;
    accent-color: #8b6914;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #f5f5f5;
    line-height: 1.4;
    flex-shrink: 0;
    text-transform: none !important;
    letter-spacing: normal;
    text-align: left;
}

.form-checkbox-group .checkbox-label {
    text-transform: none !important;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    padding: 12px 20px;
    background: transparent;
    border-top: none;
    margin: 0;
}

/* Always place cancel controls at the end (right side) in modal action rows */
.modal-actions .cancel-btn,
.modal-actions .modal-btn.cancel,
.modal-actions .cancel-edit-btn {
    order: 99;
}

.modal-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 25px; /* default pill shape across admin modals */
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

/* Reduce rounding specifically for product form actions */
.modal-actions .modal-btn.save-btn,
.modal-actions .modal-btn.cancel-btn {
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.save-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.save-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.save-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(40, 167, 69, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.save-btn:hover::before {
    left: 100%;
}

.cancel-btn {
    background: linear-gradient(135deg, #2f3136 0%, #262a2f 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.cancel-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cancel-btn:hover {
    background: linear-gradient(135deg, #3a3e44 0%, #2f3439 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.22);
}

.cancel-btn:hover::before {
    left: 100%;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 25px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-title {
        font-size: 2.2rem;
        letter-spacing: 2px;
    }

    .dashboard-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    /* Expand dashboard container width on tablets to avoid compression */
    .admin-dashboard {
        width: 95%;
        max-width: none;
    }

    .toolbar-section {
        flex-direction: row; /* keep inline on tablets */
        align-items: center;
        justify-content: center; /* center contents within full-width pill */
        padding: 20px;
        gap: 12px;
        width: 100%; /* full-width on tablets to avoid overflow */
        margin: 0 auto 40px; /* visually centered */
        flex-wrap: wrap; /* allow toolbar to break into multiple lines */
    }

    .toolbar-left {
        flex-direction: row; /* inline */
        gap: 12px;
        width: 100%; /* expand to full width when wrapping */
        flex-wrap: wrap; /* allow controls to wrap */
        justify-content: center; /* keep centered when wrapped */
    }

    .toolbar-right {
        width: 100%; /* expand to full width when wrapping */
        justify-content: center; /* center contents when wrapped */
        flex-direction: row; /* inline */
        gap: 12px;
        flex-wrap: wrap; /* allow controls to wrap */
    }

    .search-container {
        width: auto;
    }

    .search-input {
        min-width: 140px;
        max-width: 200px;
        width: auto;
        display: inline-block;
    }

    .filter-select {
        min-width: 140px;
        max-width: 180px; /* reduced for tablet */
        width: auto;
        display: inline-block;
    }

    .add-category-btn {
        width: auto;
        justify-content: center;
        padding: 14px 24px;
        font-size: 16px;
    }

    .add-product-btn {
        width: auto;
        justify-content: center;
        padding: 14px 24px;
        font-size: 16px;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .admin-actions {
        flex-direction: column;
    }

    .admin-btn {
        flex: none;
    }
}

/* One-column products on wide phones and small devices */
@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .dashboard-title {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }

    .dashboard-subtitle {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    /* Fill full width on small screens to keep products wide */
    .admin-dashboard {
        width: 100%;
        max-width: none;
    }

    .toolbar-section {
        padding: 15px;
        margin-bottom: 30px;
        gap: 14px;
        width: 100%; /* full-width on mobile */
        margin-left: auto; /* center pill horizontally */
        margin-right: auto;
        justify-content: center; /* center contents */
        flex-wrap: wrap; /* allow break into multiple lines on small screens */
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%; /* full width on mobile */
        flex-direction: column; /* stack controls vertically */
        align-items: stretch; /* let children fill container width */
        gap: 12px;
        flex-wrap: nowrap; /* stacked; no wrapping needed */
        justify-content: center;
    }

    .search-container { width: auto; }

    .search-input,
    .filter-select {
        width: 100%; /* fill toolbar pill width */
        min-width: 0; /* allow shrink within container */
        max-width: none; /* no cap on mobile */
        padding: 12px 16px;
        font-size: 15px;
        box-sizing: border-box;
    }

    .search-input { padding-left: 40px; }

    .add-category-btn,
    .add-product-btn {
        width: 100%; /* fill pill width for comfortable tapping */
        justify-content: center;
        padding: 14px 20px;
        font-size: 16px;
        box-sizing: border-box;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Sidebar Manager Modal Styles */
#sidebarManagerModal {
    display: none;
    position: fixed;
    z-index: 2100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    justify-content: center; /* center horizontally */
    align-items: center;    /* center vertically */
}

#sidebarManagerModal .modal-content {
    position: relative;
    background: linear-gradient(135deg, #2c1810 0%, #1a0f0a 100%);
    margin: 0 24px; /* remove vertical margins so it centers */
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    width: calc(100% - 48px); /* account for left/right margins so no horizontal scroll */
    max-width: 600px;
    max-height: 70vh; /* constrain overall modal height */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#sidebarManagerModal .modal-header {
    background: linear-gradient(135deg, #2c1810 0%, #1a0f0a 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebarManagerModal .modal-header h2 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
}

#sidebarManagerModal .close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sidebarManagerModal .close-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

#sidebarManagerModal .modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Responsive margins for floating look */
@media (max-width: 480px) {
    #sidebarManagerModal .modal-content {
        margin: 0 16px; /* remove vertical margins for center on mobile */
        width: calc(100% - 32px);
    }
    #sidebarManagerModal .modal-body {
        padding: 16px; /* reduce inner padding on mobile */
    }
    /* Hide footer/actions entirely on mobile to remove extra space */
    #sidebarManagerModal .modal-actions {
        display: none !important;
    }
    .add-category-section, .existing-categories-section {
        margin-bottom: 10px; /* reduce section spacing on mobile */
    }
    .category-item {
        padding: 12px; /* compact list item padding on mobile */
    }
 
    /* Make Add New Product modal look like Manage Categories on mobile */
    #productModal .product-modal {
        margin: 8% 5px; /* side margins for floating look */
        width: calc(100% - 32px); /* account for margins */
        max-width: 700px; /* preserve cap */
    }
    #productModal .modal-content {
        padding: 5px; /* compact inner padding */
    }
    /* Compact footer/actions for Add New Product on mobile (bottom inside modal) */
    #productModal .modal-actions {
        display: flex;
        gap: 10px;
        padding: 12px 16px;
        justify-content: flex-end;
        position: static;
        background: transparent;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
    }

    /* Ensure Confirm Delete body isn’t cut on mobile */
    #confirmDeleteModal {
        max-height: 80vh;
    }
    #confirmDeleteModal .modal-content {
        padding: 20px;
        width: calc(100% - 32px);
        margin: 0 16px;
        max-width: none;
        overflow-y: auto;
    }
    #confirmDeleteModal .modal-actions {
        padding: 12px 16px 16px 16px;
        /* Stack and widen actions on phones */
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    #confirmDeleteModal .modal-btn {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}
@media (min-width: 768px) {
    #sidebarManagerModal .modal-content {
        margin: 5% auto; /* center with auto margins on wider screens */
        width: 90%;
        max-width: 600px;
    }
}

.add-category-section, .existing-categories-section {
    margin-bottom: 30px;
}

.add-category-section h3, .existing-categories-section h3 {
    color: #f5f5f5;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: #f5f5f5;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #4a3426;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #3d2b1f;
    color: #f5f5f5;
}

.form-group input:focus {
    outline: none;
    border-color: #8b6914;
    background: #4a3426;
    box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.submit-btn {
    background: linear-gradient(135deg, #8b6914 0%, #6b5011 100%);
    color: white;
    border: 2px solid #8b6914;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 200px;
    height: 44px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(139, 105, 20, 0.3);
}

.submit-btn:hover {
    background: linear-gradient(135deg, #a67c16 0%, #8b6914 100%);
    box-shadow: 0 6px 20px rgba(139, 105, 20, 0.4);
    transform: translateY(-2px);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(139, 105, 20, 0.3);
}

/* Responsive: make buttons more compact on small screens */
@media (max-width: 480px) {
    .submit-btn {
        padding: 10px 16px;
        height: 40px;
        font-size: 13px;
    }
    .modal-btn {
        padding: 10px 16px;
        min-width: 110px;
        font-size: 13px;
    }
    .modal-actions {
        gap: 12px;
        padding: 16px 20px;
    }
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.category-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-item-icon {
    font-size: 18px;
}

.category-item-name {
    color: #f5f5f5;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 500;
}

.category-item-actions {
    display: flex;
    gap: 8px;
}

.category-action-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #f5f5f5;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.category-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.category-action-btn.delete {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.3);
    color: #ff6b7a;
}

.category-action-btn.delete:hover {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.5);
}

.empty-categories {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    padding: 20px;
    font-family: 'Poppins', sans-serif;
}

/* Sidebar Item Styles */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    padding-left: 30px;
}

.sidebar-item.active {
    background-color: rgba(139, 105, 20, 0.3);
    border-left: 4px solid #8b6914;
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-item-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-item-text {
    font-weight: 500;
}

/* Multiple Image Upload Styles */
.image-upload-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.upload-option {
    padding: 16px;
    border: 2px dashed rgba(84, 0, 0, 0.3);
    border-radius: 8px;
    background: rgba(84, 0, 0, 0.05);
}

.url-input-group {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.url-input-group .form-input {
    flex: 1;
    margin-bottom: 0;
}

.add-url-btn {
    background: linear-gradient(135deg, #540000 0%, #6d0000 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-url-btn:hover {
    background: linear-gradient(135deg, #6d0000 0%, #8a0000 100%);
    transform: translateY(-1px);
}

.image-preview-container {
    margin-top: 16px;
    border: 1px solid rgba(84, 0, 0, 0.2);
    border-radius: 8px;
    background: white;
    min-height: 100px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid rgba(84, 0, 0, 0.1);
    background: rgba(84, 0, 0, 0.05);
}

.preview-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: #540000;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.preview-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.export-btn, .import-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.export-btn:hover {
    background: #1976D2;
}

.import-btn {
    background: #FF9800;
}

.import-btn:hover {
    background: #F57C00;
}

.clear-all-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.clear-all-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.no-images {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #888;
    font-style: italic;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    width: 100%;
    height: 100px;
    margin: 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border: 1px dashed rgba(136, 136, 136, 0.3);
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
    min-height: 120px;
    position: relative;
}

.image-preview-grid:has(.no-images) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.image-preview-grid:empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(84, 0, 0, 0.1);
    background: white;
    transition: all 0.3s ease;
}

.image-preview-item:hover {
    border-color: rgba(84, 0, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(84, 0, 0, 0.15);
}

.image-preview-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.image-preview-controls {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
}

.image-control-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.remove-image-btn {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.remove-image-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.set-primary-btn {
    background: rgba(40, 167, 69, 0.9);
    color: white;
}

.set-primary-btn:hover {
    background: #28a745;
    transform: scale(1.1);
}

.image-preview-item.primary {
    border-color: #28a745;
    border-width: 3px;
}

.image-preview-item.primary::after {
    content: 'PRIMARY';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #28a745;
    color: white;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    padding: 2px;
}

.empty-preview-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    grid-column: 1 / -1;
}

/* Image count badge for multiple images */
.image-count-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(84, 0, 0, 0.9);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Positioning indicator styles */
.glb-preview-item.positioned {
    border: 2px solid #4CAF50;
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f5e8 100%);
}

.positioning-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #4CAF50;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.positioning-indicator i {
    font-size: 8px;
}

.positioning-info {
    font-size: 11px;
    color: #4CAF50;
    font-weight: 500;
    margin-top: 2px;
}

.control-btn.position-btn.positioned {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.control-btn.position-btn.positioned:hover {
    background: #45a049;
    border-color: #45a049;
}

/* GLB Positioning Modal Styles */
.positioning-modal {
    z-index: 10000;
}

.positioning-modal-content {
    max-width: 1200px;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
}

.positioning-workspace {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    margin: 20px 0;
    min-height: 600px;
}

.face-preview-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.face-preview-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.face-wireframe {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.face-svg {
    width: 100%;
    height: auto;
    max-width: 300px;
}

.anchor-point {
    fill: rgba(84, 0, 0, 0.6);
    stroke: #540000;
    stroke-width: 2;
    cursor: pointer;
    transition: all 0.3s ease;
}

.anchor-point:hover {
    fill: rgba(84, 0, 0, 0.8);
    r: 8;
}

.anchor-point.selected {
    fill: #540000;
    stroke: #fff;
    stroke-width: 3;
    r: 8;
}

.glb-model-preview {
    transition: all 0.3s ease;
}

.model-info {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.model-info h4 {
    margin: 0 0 8px 0;
    color: #540000;
    font-size: 16px;
}

.anchor-info {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.positioning-controls {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    max-height: 600px;
}

.control-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.control-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.control-section h3 {
    margin: 0 0 16px 0;
    color: #540000;
    font-size: 16px;
    font-weight: 600;
}

.anchor-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.anchor-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 2px solid rgba(84, 0, 0, 0.2);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    color: #540000;
}

.anchor-btn:hover {
    border-color: rgba(84, 0, 0, 0.4);
    background: rgba(84, 0, 0, 0.05);
}

.anchor-btn.active {
    border-color: #540000;
    background: rgba(84, 0, 0, 0.1);
    font-weight: 600;
}

.control-group {
    display: grid;
    grid-template-columns: 80px 1fr 50px;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.control-group label {
    font-size: 13px;
    font-weight: 500;
    color: #540000;
}

.control-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #540000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-slider::-webkit-slider-thumb:hover {
    background: #6d0000;
    transform: scale(1.1);
}

.control-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #540000;
    cursor: pointer;
    border: none;
}

.value-display {
    font-size: 12px;
    font-weight: 600;
    color: #540000;
    text-align: center;
    background: rgba(84, 0, 0, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 40px;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.preset-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid rgba(84, 0, 0, 0.2);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    color: #540000;
}

.preset-btn:hover {
    border-color: #540000;
    background: rgba(84, 0, 0, 0.05);
    transform: translateY(-1px);
}

.reset-btn {
    background: #6c757d;
    border-color: #6c757d;
}

.reset-btn:hover {
    background: #5a6268;
    border-color: #5a6268;
}

/* Position button in GLB preview */
.position-btn {
    background: rgba(84, 0, 0, 0.9);
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.position-btn:hover {
    background: #540000;
    transform: scale(1.1);
}

.glb-preview-item.positioned {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.positioning-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 2;
}

/* Responsive design */
@media (max-width: 1024px) {
    .positioning-workspace {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .positioning-modal-content {
        width: 98vw;
        max-height: 95vh;
    }
    
    .anchor-buttons {
        grid-template-columns: 1fr;
    }
    
    .preset-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .control-group {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }
    
    .control-group label {
        font-size: 12px;
    }
}

/* Apply 2-column products only between 641px and 768px */
@media (min-width: 641px) and (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.glb-preview-container {
    margin-top: 16px;
    border: 1px solid rgba(84, 0, 0, 0.2);
    border-radius: 8px;
    background: white;
    min-height: 100px;
}

.glb-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
    min-height: 120px;
    position: relative;
}

.glb-preview-grid:has(.no-images) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.glb-preview-grid:empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.glb-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(84, 0, 0, 0.1);
    background: white;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    padding: 12px;
}

.glb-preview-item:hover {
    border-color: rgba(84, 0, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(84, 0, 0, 0.15);
}

.glb-file-icon {
    position: relative;
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.glb-icon-background {
    position: relative;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #540000 0%, #6d0000 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 8px rgba(84, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.glb-main-icon {
    font-size: 16px;
    z-index: 2;
}

.glb-format-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #ff6b35;
    color: white;
    font-size: 8px;
    font-weight: bold;
    padding: 1px 3px;
    border-radius: 3px;
    line-height: 1;
    border: 1px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.glb-3d-indicator {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 6px;
    border: 1px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.glb-preview-item:hover .glb-icon-background {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(84, 0, 0, 0.4);
}

.glb-file-info {
    text-align: center;
    width: 100%;
}

.glb-file-name {
    font-weight: 600;
    color: #333;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    width: 100%;
}

.glb-file-size {
    font-size: 10px;
    color: #666;
}

.glb-preview-controls {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
}

.glb-preview-controls .control-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.glb-preview-controls .control-btn.move-up,
.glb-preview-controls .control-btn.move-down {
    background: rgba(0, 123, 255, 0.9);
    color: white;
}

.glb-preview-controls .control-btn.move-up:hover,
.glb-preview-controls .control-btn.move-down:hover {
    background: #007bff;
    transform: scale(1.1);
}

.glb-preview-controls .control-btn.remove {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.glb-preview-controls .control-btn.remove:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.glb-preview-controls .control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}